<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta name="referrer" content="no-referrer">
    <title>sirius's blog</title>
    <link rel="stylesheet" href="../../static/libs/assets/editor.md-master/examples/css/style.css" th:href="@{/libs/assets/editor.md-master/examples/css/style.css}"/>
    <link rel="stylesheet" href="../../static/libs/assets/editor.md-master/css/editormd.css" th:href="@{/libs/assets/editor.md-master/css/editormd.css}"/>
    <!--bootstrap-3.3.7-->
    <link rel="stylesheet" type="text/css" href="../../static/libs/assets/bootstrap-3.3.7/css/bootstrap.css"
          th:href="@{/libs/assets/bootstrap-3.3.7/css/bootstrap.css}">
    <!--加载机制覆盖上面-->
    <link href="../../static/css/admin/admin.css" rel="stylesheet" type="text/css" th:href="@{css/admin/admin.css}">

</head>
<body>

<div id="layout">
    <div id="test-editormd">
        <textarea id="editor-md-doc" name="editor-md-doc" style="display:none;" th:text="${article!=null?article.articleContent:''}"></textarea>
        <!--<textarea id="editor-md-html" name="editor-md-html"></textarea>-->
    </div>
</div>
<!--todo 放在这里无效-->
<!--<script th:src="@{/js/article_editor.js}" src="../../static/js/article_editor.js"></script>-->
<!--<script src="../../static/libs/assets/editor.md-master/examples/js/jquery.min.js" th:src="@{/libs/assets/editor.md-master/examples/js/jquery.min.js}"></script>-->
<script src="../../static/libs/assets/editor.md-master/editormd.min.js" th:src="@{/libs/assets/editor.md-master/editormd.min.js}"></script>
<script type="text/javascript">
    /*编辑器配置*/
    var testEditor;
    $(function () {
        testEditor = editormd("test-editormd", {
            width: "92%",//编辑器大小官方默认90%
            height: 900,
            syncScrolling: "single",
            //path: "../../static/libs/assets/editor.md-master/lib/",//这个编辑器文件的lib路径,一定要写对不然404
            path: "/libs/assets/editor.md-master/lib/",//这个编辑器文件的lib路径,一定要写对不然404
            saveHTMLToTextarea : true,//注意3：这个配置，textarea可以提交
            /*编辑设置*/
            emoji: true,//emoji表情，默认关闭
            tocm : true, // Using [TOCM]
            tex : true, // 开启科学公式TeX语言支持，默认关闭
            flowChart : true, // 开启流程图支持，默认关闭
            /**上传图片相关配置如下*/
            imageUpload : true,
            imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
            imageUploadURL : "/admin/writing/photosSubmit",//注意你后端的上传图片服务地址
            onload: function () { //上传成功之后的回调

            },
            //editorTheme: "pastel-on-dark",//编辑器的主题颜色
            theme : "default | dark",//顶部的主题
            previewTheme: "dark"//显示的主题
        });
    });
</script>
</body>
</html>